I wanted to use Linux on AArch64 (also known as ARM64), to investigate building a statically-linked Stack executable for that platform. I had a Mac mini M1, 2020 – the M1 chip implements AArch64. So, I investigated virtual machines (VM). I had prior experience of using Linux on x86_64 via WSL 2 on Windows.
UTM for macOS
I found UTM for macOS. It was straightforward to install and straightforward to set up with images for Ubuntu Server for ARM (Ubuntu 22.04.4 LTS) and Alpine Linux Standard for aarch64 (3.19.1), although I underestimated the disk space for the former (eventually settling on 64 GB) and overestimated the disk space for the latter (having set it up with 48 GB).
ubuntu-desktop-minimal
After some false starts, I discovered you can obtain Ubuntu Desktop without the ‘bloat’ with sudo apt-get install ubuntu-desktop-minimal
and then reboot
. However, for my purpose, I wanted something lighter still.
setup-desktop with xfce
On Alpine Linux, as user root
, the script setup-desktop
followed by the choice of the xfce
alternative set up a desktop environment.
doas
, in the main
package repository, has replaced sudo
(now in the community
repository). The root user can install it with apk add doas
. I had trouble with its configuration for a new user: the Alpine Linux documentation implied that the configuration file should be /etc/doas.d/doas.conf
, other sources referred to etc/doas.conf
. Perhaps the content of the configuration file was a missing an essential new line at the end.
I also had trouble with keyboard layout configuration, finally settling on ‘English (UK)’ variant ‘English (UK, Macintosh)’. I discovered that the # character can only be generated by the righthand ALT key + 3.
I also needed to configure the mouse settings to reverse the scrolling direction: dragging down drags the window content down and moves the scroll bar up.
Stack depends on the digest
package, which makes use of pkg-config
to locate zlib
by default. doas apk add pkgconf
provided the former. I discovered that doas apk add zlib-dev
(not zlib
) provided the latter.